TARGET1=Game
TARGET2=Client
TARGET3=Server
LIBS=-lsocket -lnsl
CARGS=-Wall -g

all: $(TARGET1) $(TARGET2) $(TARGET3)

$(TARGET1):Game_test.o Game.o Game.h
	g++ Game_test.o Game.o -o $@ $(CARGS)

$(TARGET2):Client.o
	g++ Client.o -o $@ $(LIBS) $(CARGS)
	
$(TARGET3):Alfred.o Game.o Server.o
	g++ Alfred.o Game.o Server.o -o $@ $(LIBS) $(CARGS)

.cpp.o:
	g++ -c -Wall $< -o $@

clean:
	rm -f $(TARGET1)
	rm -f $(TARGET2)
	rm -f $(TARGET3)
	rm -f *.o